package version1;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.HashMap;

public class preProcess {
	public static void main(String[] args) throws IOException {
		FileReader f = new FileReader(args[0]);
		BufferedReader bufin = new BufferedReader(f);
		
		File file = new File(args[1]);
		FileOutputStream f1 = new FileOutputStream(file);
		ObjectOutputStream os = new ObjectOutputStream(f1);
		HashMap<Integer,String> np = new HashMap<Integer,String>();
		String msg = null;
		while((msg = bufin.readLine())!=null){
			String[] s = msg.split("\\t");
			int nPhrase = Integer.valueOf(s[0]).intValue();
		    np.put(nPhrase, s[1]);
		}
		os.writeObject(np);
		os.flush();
		os.close();
		f1.close();		
	}
}
